<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //原型链的最终指向是object
        function People(name) {
            this.name=name;
        }
        People.prototype.showName=function () {
            console.log(this.name);
        }

        function Student() {
            
        }
        //
        Student.prototype=new People("张三");

        //对象
        Student.prototype.study=function () {
            console.log("学习");
        }
        var stu=new Student();
        // stu.study();
        // stu.showName();

        // Student.prototype
        // console.dir(stu.__proto__===Student.prototype);
        // console.dir(Student.prototype.__proto__===People.prototype);
        // console.dir(stu.__proto__.__proto__===People.prototype);
        // console.dir(People.prototype.__proto__.__proto__);
        console.dir(stu.__proto__.__proto__.__proto__.__proto__);
        //  Student.prototype  People.prototype   Object.prototype  null
    </script>
</head>
<body>
    
</body>
</html>